More Related Content
Similar to MATLAB_曲面作图 (20)
More from byron zhao (20)
MATLAB_曲面作图
- 1. 西 安 电 子 科 技 大 学 理 学 院 王 勋 志
曲 面 作 图
一、常见的曲面作图(Matlab 7.0) 1
1、椭圆锥面 1
2、椭圆抛物面 2
3、椭球面 3
4、双曲抛物面 4
5、单叶双曲面 5
6、双叶双曲面 6
二、旋转曲面 7
三、螺旋面 11
一、常见的曲面作图( Matlab 7.0)
1、椭圆锥面
曲面方程:
或:
取 θ =30 ,θ =30 用 MATLAB 作图:
1
o
2
o
M 文件代码:
u=[0:pi/600:2*pi]; v=[0:pi/600:2*pi];
[U,V]=meshgrid(u,v);
E1=pi/6;E2=pi/6;
X=U*tan(E1).*cos(V);
Y=U*tan(E2).*sin(V);
Z=U;
mesh(X,Y,Z);
axis auto;
绘制出来的图形:
- 2. 2、椭圆抛物面
曲面方程:
或:
取 a=4,b=3 在 MATLAB 中作图:
M 文件代码:
ezsurf('4*u*cos(v)', ...
'3*u*sin(v)','u^2', ...
[-pi/2,3*pi/2,0,2*pi]);
axis auto;
绘制出来的图形:
- 3. 3、椭球面
曲面方程:
或:
取 a=8,b=6,c=4 在 MATLAB 中作图:
M 文件代码):
u=[0:pi/60:2*pi]; v=[0:pi/60:2*pi];
[U,V]=meshgrid(u,v);
A=8;B=6;C=4;
X=A*cos(V).*cos(U);
Y=B*cos(V).*sin(U);
Z=C*sin(V);
surf(X,Y,Z);
axis equal;
绘制出来的图形:
- 4. 4、双曲抛物面
曲面方程:
或: 取 a=8,b=6,c=4 在 MATLAB 中作图:
取 a=6,b=5 在 MATLAB 中作图:
M 文件代码:
x=[-5:0.01:5]; y=[-5:0.01:5];
[X,Y]=meshgrid(x,y);
a=6;b=5;
Z=(X/a).^2-(Y/b).^2;
mesh(X,Y,Z);
axis auto;
绘制出来的图形:
- 5. 5、单叶双曲面
曲面方程:
或:
取 a=3,b=3,c=5 在 MATLAB 中作图:
M 文件代码:
ezsurf('3*cosh(u).*cos(v)', ...
'3*cosh(u).*sin(v)','5*sinh(u)', ...
[-pi/2,pi/2,0,2*pi]);
axis auto
绘制出来的图形:
- 6. 6、双叶双曲面
曲面方程:
或:
取 a=3,b=4,c=7 在 MATLAB 中作图:
M 文件代码:
ezsurf('3*tan(u)*cos(v)', ...
'4*tan(u)*sin(v)','7*sec(u)', ...
[-pi/2,3*pi/2,0,2*pi]);
axis auto;
绘制出来的图形:
- 7. 二、旋转曲面
曲面方程: (0≤u≤2π,a≤v≤b)
1、取 f(v)=tanv,g(v)=5v,在 MATLAB 中作图:
A、取 a=2.5,b=3 时,
M 文件代码:
ezsurf('tan(v)*cos(u)', ...
'tan(v)*sin(u)','5*v', ...
[0,2*pi,2.5,3]);
axis auto;
绘制出来的图形:
- 8. B、取 a=-4,b=4 时
M 文件代码:
ezsurf('tan(v)*cos(u)', ...
'tan(v)*sin(u)','5*v', ...
[0,2*pi,-4,4]);
axis auto;
绘制出来的图形:
- 9. 2、取 f(v)=sinv,g(v)= 2v,在 MATLAB 中作图:
A、取 a=0,b=2 时,
M 文件代码:
ezsurf('sin(v)*cos(u)', ...
'sin(v)*sin(u)','2*v', ...
[0,2*pi,0,2]);
axis auto;
绘制出来的图形:
- 10. B、取 a=-4,b=4 时,
M 文件代码:
ezsurf('sin(v)*cos(u)', ...
'sin(v)*sin(u)','2*v', ...
[0,2*pi,-4,4]);
axis auto;
绘制出来的图形:
- 11. 三、螺旋面
曲面方程: (0≤u≤2π,a≤v≤b)
1、取 f(v)= v,g(v)=v, a=-5,b=5 在 MATLAB 中作图:
M 文件代码:
ezsurf('v*cos(u)', ...
'v*sin(u)','v+8*u', ...
[0,2*pi,-5,5]);
axis auto;
绘制出来的图形:
- 12. 2、取 f(v)= v2,g(v)=2v, a=-10,b=10 在 MATLAB 中作图:
M 文件代码:
ezsurf('v.^2*cos(u)', ...
'v.^2*sin(u)','2*v+8*u', ...
[0,2*pi,-10,10]);
axis auto;
绘制出来的图形:
- 13. 第 1 页 共 13 页
作者 EMAIL:hiwxzh@163.com